package com.sxjh.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sxjh.entity.Contract;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sxjh.entity.param.ContractListParam;
import com.sxjh.entity.result.ContractListResult;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 合同管理 Mapper 接口
 * </p>
 *
 * @author zixin
 * @since 2021-07-28
 */
public interface ContractMapper extends BaseMapper<Contract> {

  IPage<ContractListResult> list(IPage<Void> iPage, @Param("param") ContractListParam param);
  IPage<ContractListResult> list1(IPage<Void> iPage, @Param("param") ContractListParam param);
  IPage<ContractListResult> list2(IPage<Void> iPage, @Param("param") ContractListParam param);

  // 查询该物料是否属于焦炭
  @Select("select m.id from materials m left join material_categories mc on m.category_id = mc.id where mc.id = 3 and m.id = #{id}")
  Integer isJt(Integer id);

}
